<?php
class syslog extends admin{
	
    public function index(){
        $where = " where  1=1 and school_id='" . $_SESSION['client']['jx_id'] . "'";
        if(!empty(trim($_GET['type']))){
            $where.=' and type =  "' . trim($_GET['type'] . '"');
		}
        if(!empty($_GET['m'])){
            $where.=' and modules ="'. $_GET['m'] . '" ';
        }
        $total=db()->getOne("select count(*) from x_log". $where);
        $pagesize=10;
        if (isset($_GET['p']) && (int) $_GET['p'] > 0) $p = (int) $_GET['p'];
        else $p = 1;
        $limit=' limit '.($p-1)*$pagesize.','.$pagesize;
        $res = db()->getAll("select beizhu,operation_name,time,type,ip,modules from x_log ".$where." order by id desc ".$limit);
		if(!$res) $res=array();
        $page = array('total' => $total,'pagesize' =>$pagesize,'curpage' => $p);
        $this->ajaxReturn(array('status'=>1,'data'=>$res,'page'=>$page));
    }
}













































































